home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 329_01 / st_lexyy.c < prev    next >
C/C++ Source or Header  |  1990-11-27  |  32KB  |  1,080 lines

  1. #define FLEX_COMPRESSED
  2. /* A lexical scanner generated by flex */
  3.  
  4. /* scanner skeleton version:
  5.  * $Header: flex.skl,v 2.0.0.1 89/07/30 23:20:47 pcd Exp Locker: pcd $
  6.  */
  7.  
  8. #include <stdio.h>
  9.  
  10. #define FLEX_SCANNER
  11.  
  12. /* define PROTOTYPES */
  13. #if 0
  14. #ifdef __STDC__
  15. #ifndef MWC /* Mark Williams thinks it's __STDC__, how strange
  16.         --HdeF
  17.         */
  18. #define PROTOTYPES
  19. #endif
  20. #endif
  21. #endif
  22.  
  23. /* amount of stuff to slurp up with each read */
  24. #ifndef YY_READ_BUF_SIZE
  25. #define YY_READ_BUF_SIZE 8192
  26. #endif
  27.  
  28. #ifndef YY_BUF_SIZE
  29. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of input buffer */
  30. #endif
  31.  
  32. /* returned upon end-of-file */
  33. #define YY_END_TOK 0
  34.  
  35. /* copy whatever the last rule matched to the standard output */
  36.  
  37. #define ECHO fputs( yytext, yyout )
  38.  
  39. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  40.  * is returned in "result".
  41.  */
  42. #define YY_INPUT(buf,result,max_size) \
  43.     if ( (result = read( fileno(yyin), buf, max_size )) < 0 ) \
  44.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  45. #define YY_NULL 0
  46. #define yyterminate() return ( YY_NULL )
  47.  
  48. /* report a fatal error */
  49. #define YY_FATAL_ERROR(msg) \
  50.     { \
  51.     fputs( msg, stderr ); \
  52.     putc( '\n', stderr ); \
  53.     exit( 1 ); \
  54.     }
  55.  
  56. /* default yywrap function - always treat EOF as an EOF */
  57. #define yywrap() 1
  58.  
  59. /* enter a start condition.  This macro really ought to take a parameter,
  60.  * but we do it the disgusting crufty way forced on us by the ()-less
  61.  * definition of BEGIN
  62.  */
  63. #define BEGIN yy_start = 1 + 2 *
  64.  
  65. /* action number for EOF rule of a given start state */
  66. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  67.  
  68. /* special action meaning "start processing a new file" */
  69. #define YY_NEW_FILE goto new_file
  70.  
  71. /* default declaration of generated scanner - a define so the user can
  72.  * easily add parameters
  73.  */
  74.  
  75. #ifdef PROTOTYPES
  76. #define YY_DECL int yylex(/* void */ )/*Mark Williams thinks it's standard!! */
  77. #else
  78. #define YY_DECL int yylex()
  79. #endif
  80.  
  81. /* code executed at the end of each rule */
  82. #define YY_BREAK break;
  83.  
  84. #define YY_END_OF_BUFFER_CHAR 0
  85.  
  86. /* done after the current pattern has been matched and before the
  87.  * corresponding action - sets up yytext
  88.  */
  89. #define YY_DO_BEFORE_ACTION \
  90.     yytext = yy_bp; \
  91.     yy_hold_char = *yy_cp; \
  92.     *yy_cp = '\0'; \
  93.     yy_c_buf_p = yy_cp;
  94.  
  95. /* returns the length of the matched text */
  96. #define yyleng (yy_cp - yy_bp)
  97.  
  98. #define EOB_ACT_RESTART_SCAN 0
  99. #define EOB_ACT_END_OF_FILE 1
  100. #define EOB_ACT_LAST_MATCH 2
  101.  
  102. /* return all but the first 'n' matched characters back to the input stream */
  103. #define yyless(n) \
  104.     { \
  105.     *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
  106.     yy_c_buf_p = yy_cp = yy_bp + n; \
  107.     YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  108.     }
  109.  
  110. #define unput(c) yyunput( c, yy_bp )
  111.  
  112. #define YY_USER_ACTION
  113.  
  114. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  115. char *yytext;
  116.  
  117. #ifndef PROTOTYPES
  118. #define const
  119. #endif
  120.  
  121. #define INITIAL 0
  122. /* csubst.l */
  123. /* lex source of csubst utility.
  124. This programme is shareware.
  125. If you found this programme useful then send me a colourful postcard
  126. with the words "Happy Birthday" (or equivalent) so that it arrives
  127. at my address around the first of January 1991.
  128.  
  129. Henri de Feraudy
  130. 27 rue Chef de Ville
  131. 92140 Clamart 
  132. France
  133. */
  134. extern int  Mode, Truncation;
  135. extern char *lookup_subst();
  136. #include <stdio.h>
  137. #include "csubst.h"
  138. #define cond_putchar(C) if(Mode == APPLY_SUBSTS || Mode == PRINT_TRUNCATED)putchar(C);
  139.  
  140. #ifdef yywrap
  141. #undef yywrap
  142. #define yywrap() (!next_yyin())
  143. #endif
  144.  
  145. void action_keyword(), default_action(), action_symbol(), read_comment();
  146. #define CPP_MACRO 1
  147. #define YY_END_OF_BUFFER 46
  148. typedef int yy_state_type;
  149. static const short int yy_accept[337] =
  150.     {   0,
  151.         0,    0,    0,    0,   46,   44,   42,   44,   44,   44,
  152.        44,   44,   41,   41,   41,   41,   41,   41,   41,   41,
  153.        41,   41,   41,   41,   41,   41,   41,   41,   40,   40,
  154.        40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
  155.        40,   40,   40,   40,    0,   38,    0,    0,    5,    5,
  156.         5,    0,    0,    1,    0,   41,   41,   41,   41,   41,
  157.        41,   41,   13,   41,   41,   41,   41,   41,   41,   21,
  158.        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  159.        41,   40,   40,   40,   40,   40,   40,   40,   13,   40,
  160.        40,   40,   40,   40,   40,   21,   40,   40,   40,   40,
  161.  
  162.        40,   40,   40,   40,   40,   40,   40,    5,    5,    5,
  163.         5,   39,   43,   41,   41,   41,   41,   41,   41,   41,
  164.        41,   41,   41,   41,   19,   41,   22,   41,   41,   41,
  165.        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  166.        41,   41,   40,   40,   40,   40,   40,   40,   40,   40,
  167.        40,   40,   40,   19,   40,   22,   40,   40,   40,   40,
  168.        40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
  169.        40,    5,    5,    5,    5,    6,   41,    8,    9,   41,
  170.        41,   41,   41,   15,   16,   41,   41,   20,   23,   41,
  171.        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
  172.  
  173.        35,   41,   41,    6,   40,    8,    9,   40,   40,   40,
  174.        40,   15,   16,   40,   40,   20,   23,   40,   40,   40,
  175.        40,   40,   40,   40,   40,   40,   40,   40,   35,   40,
  176.        40,    5,    5,    5,    5,    7,   10,   41,   41,   41,
  177.        41,   18,   41,   41,   26,   41,   41,   41,   41,   41,
  178.        41,   33,   41,   41,   37,    7,   10,   40,   40,   40,
  179.        40,   18,   40,   40,   26,   40,   40,   40,   40,   40,
  180.        40,   33,   40,   40,   37,    5,    3,    5,    5,   41,
  181.        41,   14,   17,   41,   25,   27,   28,   29,   30,   31,
  182.        41,   41,   41,   40,   40,   14,   17,   40,   25,   27,
  183.  
  184.        28,   29,   30,   31,   40,   40,   40,    4,    5,   41,
  185.        12,   41,   32,   41,   41,   40,   12,   40,   32,   40,
  186.        40,    4,    5,   11,   24,   34,   36,   11,   24,   34,
  187.        36,    0,    0,    0,    2,    0
  188.     } ;
  189.  
  190. static const char yy_ec[128] =
  191.     {   0,
  192.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  193.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  194.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  195.         1,    2,    1,    4,    5,    1,    1,    1,    6,    1,
  196.         1,    7,    1,    1,    1,    8,    9,   10,   11,   11,
  197.        11,   11,   11,   11,   11,   11,   11,    1,    1,   12,
  198.         1,   13,    1,    1,   14,   14,   14,   14,   14,   14,
  199.        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
  200.        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
  201.         1,   16,    1,    1,   17,    1,   18,   19,   20,   21,
  202.  
  203.        22,   23,   24,   25,   26,   15,   27,   28,   29,   30,
  204.        31,   32,   15,   33,   34,   35,   36,   37,   38,   39,
  205.        40,   41,    1,    1,    1,    1,    1
  206.     } ;
  207.  
  208. static const char yy_meta[42] =
  209.     {   0,
  210.         1,    2,    1,    1,    1,    3,    1,    4,    4,    5,
  211.         5,    1,    1,    6,    7,    4,    8,    6,    6,    6,
  212.         6,    6,    6,    7,    7,    7,    7,    7,    7,    7,
  213.         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
  214.         7
  215.     } ;
  216.  
  217. static const short int yy_base[345] =
  218.     {   0,
  219.         0,    0,   41,    0,  415,  416,  416,   79,   82,  398,
  220.       406,  373,    0,  375,  377,   67,   65,   58,   62,  378,
  221.        71,  377,  385,   74,  366,  375,  373,  378,    0,  366,
  222.       368,   86,   83,   85,   79,  369,   93,  368,  376,   93,
  223.       357,  366,  364,  369,  116,  416,  390,  100,    0,  370,
  224.        99,  119,  124,  416,    0,    0,  356,  368,  355,  370,
  225.       357,  363,  349,  350,  347,  347,  350,  347,  344,    0,
  226.       343,  347,  109,  345,   65,  116,  349,  342,  111,  110,
  227.       347,    0,  337,  349,  336,  351,  338,  344,  330,  331,
  228.       328,  328,  331,  328,  325,    0,  324,  328,  115,  326,
  229.  
  230.       116,  123,  330,  323,  117,  120,  328,    0,  330,  131,
  231.       332,  416,  416,  320,  332,  327,  315,  119,  329,  327,
  232.       323,  315,  321,  324,    0,  310,    0,  316,  313,  302,
  233.       304,